﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HudRageEffect : MonoBehaviour
{
    [SerializeField]
    private GameObject rage1;
    [SerializeField]
    private GameObject rage2;
    [SerializeField]
    private GameObject rage3;
    [SerializeField]
    private GameObject root;

    private int currentRage = -1;
    
    public void SetRage(int costRage)
    {
        currentRage = costRage;
        switch (costRage)
        {
            case 1:
                rage1.SetActive(false);
                break;
            case 2:
                rage2.SetActive(false);
                break;
            case 3:
                rage3.SetActive(false);
                break;
            case 4:
                break;
        }
        root.SetActive(true);
    }
    
    public void RecoverRage()
    {
        switch (currentRage)
        {
            case 1:
                rage1.SetActive(true);
                break;
            case 2:
                rage2.SetActive(true);
                break;
            case 3:
                rage3.SetActive(true);
                break;
            case 4:
                break;
        }

        currentRage = -1;
        root.SetActive(false);
    }

    public void Play(int rage)
    {
        RecoverRage();
        SetRage(rage);
    }
}
